package com.yilin.tms.truck.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yilin.tms.core.application.PageData;
import com.yilin.tms.core.entity.truck.TruckSource;
import com.yilin.tms.core.entity.truck.TruckVehicle;
import com.yilin.tms.core.entity.user.account.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 车辆Mapper
 *
 * @author zhangjinyuan
 * @date 2022/10/24
 */
@Mapper
@Repository
public interface TruckVehicleMapper extends BaseMapper<TruckVehicle> {

    /**
     * 根据公共车辆类型获取空闲的司机
     */
    String[] getTruckUserListByMatchRank(@Param("matchRank") Integer matchRank);

    /**
     * 获取组织拥有的公共车辆类型
     */
    List<String> getCommTruckTypeIdByOrganId(@Param("organizeId") String organizeId);

    /**
     * 查询我的车辆
     * */
    List<TruckVehicle> getVehicleListByOrganizeId(String organizeId, TruckVehicle query);
    /**
     * 查询我的车辆
     * */
    List<TruckVehicle> getVehicleListByTruckUserId(String userId);


    /**
     * 获取车辆空闲的车主
     */
    String[] getTruckUserListByUnused();

    PageData<TruckVehicle> getTruckVehiclePage(@Param("page")PageData<TruckVehicle> pageQuery,@Param("loginUser") Account loginUser,
                                               @Param("query")TruckVehicle query);
}
